home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 2000 February
/
Macworld (2000-02).dmg
/
Games World
/
Hot demos!
/
Starbound II
/
AI agents
/
Gypsum 1.00
/
Gypsum 1.00.rsrc
/
ss$t_134
< prev
next >
Wrap
Text File
|
1999-10-30
|
981b
|
52 lines
situation orbital_deployment
vars
send : integer;
target : integer;
success : boolean;
function max_send_down() : integer;
vars
total : integer;
i : integer;
begin
total := 0;
i := 1; // troop type 0 is colonist (which can't be sent down)
while (i < 8) do
begin
total := total + Num_unit_type_fleet(i);
i := i + 1;
end;
if (total > 8) then
total := 8;
return total;
end;
function deploy_random_squad(number : integer) : none;
vars
success : boolean;
type : integer;
begin
while (number > 0) do
begin
type := Random(7) + 1;
success := Add_unit_to_drop_ship(type);
if success then
number := number - 1;
end;
end;
begin
// first determine the total number of troops on board the fleet
send := Random(max_send_down()) + 1;
deploy_random_squad(send);
target := Random(127);
success := Deploy_drop_ship(target);
end;